package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.javapracticaltraining.entity.BaseData;
import java.util.Date;
import lombok.Data;

/**
 * 老人信息表
 * @TableName elderly
 */
@TableName(value ="elderly")
@Data
public class Elderly implements BaseData {
    /**
     * 老人ID
     */
    @TableId(value = "elderly_id", type = IdType.AUTO)
    private Integer elderlyId;

    /**
     * 姓名
     */
    @TableField(value = "name")
    private String name;

    /**
     * 性别
     */
    @TableField(value = "gender")
    private String gender;

    /**
     * 年龄
     */
    @TableField(value = "age")
    private Integer age;

    /**
     * 身份证号
     */
    @TableField(value = "id_card")
    private String idCard;

    /**
     * 护理等级ID
     */
    @TableField(value = "care_level_id")
    private Integer careLevelId;

    /**
     * 入住日期
     */
    @TableField(value = "admission_date")
    private Date admissionDate;

    /**
     * 退住日期
     */
    @TableField(value = "discharge_date")
    private Date dischargeDate;

    /**
     * 状态（在住、退住）
     */
    @TableField(value = "status")
    private String status;

    /**
     * 紧急联系人电话
     */
    @TableField(value = "urgency_phone")
    private String urgencyPhone;

    /**
     * 紧急联系人姓名
     */
    @TableField(value = "urgency_contact")
    private String urgencyContact;

    /**
     * 紧急联系人关系
     */
    @TableField(value = "urgency_relation")
    private String urgencyRelation;

    /**
     * 房间号
     */
    @TableField(value = "room_number")
    private String roomNumber;

    /**
     * 健康状况概述
     */
    @TableField(value = "health_condition")
    private String healthCondition;

    /**
     * 特殊护理需求
     */
    @TableField(value = "special_needs")
    private String specialNeeds;

    /**
     * 备注
     */
    @TableField(value = "remarks")
    private String remarks;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Elderly other = (Elderly) that;
        return (this.getElderlyId() == null ? other.getElderlyId() == null : this.getElderlyId().equals(other.getElderlyId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getGender() == null ? other.getGender() == null : this.getGender().equals(other.getGender()))
            && (this.getAge() == null ? other.getAge() == null : this.getAge().equals(other.getAge()))
            && (this.getIdCard() == null ? other.getIdCard() == null : this.getIdCard().equals(other.getIdCard()))
            && (this.getCareLevelId() == null ? other.getCareLevelId() == null : this.getCareLevelId().equals(other.getCareLevelId()))
            && (this.getAdmissionDate() == null ? other.getAdmissionDate() == null : this.getAdmissionDate().equals(other.getAdmissionDate()))
            && (this.getDischargeDate() == null ? other.getDischargeDate() == null : this.getDischargeDate().equals(other.getDischargeDate()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getUrgencyPhone() == null ? other.getUrgencyPhone() == null : this.getUrgencyPhone().equals(other.getUrgencyPhone()))
            && (this.getUrgencyContact() == null ? other.getUrgencyContact() == null : this.getUrgencyContact().equals(other.getUrgencyContact()))
            && (this.getUrgencyRelation() == null ? other.getUrgencyRelation() == null : this.getUrgencyRelation().equals(other.getUrgencyRelation()))
            && (this.getRoomNumber() == null ? other.getRoomNumber() == null : this.getRoomNumber().equals(other.getRoomNumber()))
            && (this.getHealthCondition() == null ? other.getHealthCondition() == null : this.getHealthCondition().equals(other.getHealthCondition()))
            && (this.getSpecialNeeds() == null ? other.getSpecialNeeds() == null : this.getSpecialNeeds().equals(other.getSpecialNeeds()))
            && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getElderlyId() == null) ? 0 : getElderlyId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getGender() == null) ? 0 : getGender().hashCode());
        result = prime * result + ((getAge() == null) ? 0 : getAge().hashCode());
        result = prime * result + ((getIdCard() == null) ? 0 : getIdCard().hashCode());
        result = prime * result + ((getCareLevelId() == null) ? 0 : getCareLevelId().hashCode());
        result = prime * result + ((getAdmissionDate() == null) ? 0 : getAdmissionDate().hashCode());
        result = prime * result + ((getDischargeDate() == null) ? 0 : getDischargeDate().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getUrgencyPhone() == null) ? 0 : getUrgencyPhone().hashCode());
        result = prime * result + ((getUrgencyContact() == null) ? 0 : getUrgencyContact().hashCode());
        result = prime * result + ((getUrgencyRelation() == null) ? 0 : getUrgencyRelation().hashCode());
        result = prime * result + ((getRoomNumber() == null) ? 0 : getRoomNumber().hashCode());
        result = prime * result + ((getHealthCondition() == null) ? 0 : getHealthCondition().hashCode());
        result = prime * result + ((getSpecialNeeds() == null) ? 0 : getSpecialNeeds().hashCode());
        result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", elderlyId=").append(elderlyId);
        sb.append(", name=").append(name);
        sb.append(", gender=").append(gender);
        sb.append(", age=").append(age);
        sb.append(", idCard=").append(idCard);
        sb.append(", careLevelId=").append(careLevelId);
        sb.append(", admissionDate=").append(admissionDate);
        sb.append(", dischargeDate=").append(dischargeDate);
        sb.append(", status=").append(status);
        sb.append(", urgencyPhone=").append(urgencyPhone);
        sb.append(", urgencyContact=").append(urgencyContact);
        sb.append(", urgencyRelation=").append(urgencyRelation);
        sb.append(", roomNumber=").append(roomNumber);
        sb.append(", healthCondition=").append(healthCondition);
        sb.append(", specialNeeds=").append(specialNeeds);
        sb.append(", remarks=").append(remarks);
        sb.append("]");
        return sb.toString();
    }
}
